package thread;
class myThread1 implements Runnable {
    @Override
    public void run() {
        System.out.println("第二种方法");
    }
}
public class demo2 {
    public static void main(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("实现Runnable,使用匿名内部类");
            }
        });
        t.start();
    }
    public static void main1(String[] args) {
        myThread1 t1 = new myThread1();
        Thread t = new Thread(t1);
        t.start();
    }
}
